/*
 * loadCatalog.java
 *
 * Created on March 26, 2007, 7:11 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.actions;

import javax.servlet.http.*;
import edu.byu.isys413.group1E.data.*;
import edu.byu.isys413.group1E.handlers.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

/**This action searches the database for a list of rental items that match the queried string
 *
 * @author Jon Tehero
 */
public class searchRental implements edu.byu.isys413.web.Action {
    
    /** Creates a new instance of loadCatalog */
    public searchRental() {
    }
    
    /** Processes a number guess */
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
        
        String query = (String)request.getParameter("query");
        String category = (String)request.getParameter("category");
        
        HttpSession session = request.getSession();
        RntlHandler rHandler = RntlHandler.getInstance();
        TransactionDAO TXDAO = TransactionDAO.getInstance();
        UpdateController updateController = UpdateController.getInstance();
        
        ArrayList<ForRentBO> rentalCatalog = rHandler.lookupByKeyword(category, query);

        
        request.setAttribute("rentalCatalog", rentalCatalog);
  
        return "rentalCatalog.jsp";
    }//process
    
    
}//loadCatalog class
